package com.zjcode.cdcer.controller;

import com.chinatechstar.component.commons.controller.BaseController;
import com.chinatechstar.component.commons.result.ListResult;
import com.chinatechstar.component.commons.result.ResultBuilder;
import com.chinatechstar.component.commons.supports.PageData;
import com.zjcode.cdcer.model.basic.JsonObj;
import com.zjcode.cdcer.service.CerCasUsersyncinfoService;
import java.util.HashMap;
import java.util.Map;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName:CerCasUsersyncinfoController
 * @功能：
 * @author：wlei
 * @日期：2023/2/7-01:02
 **/
@RestController
@Slf4j
@RequestMapping("/v1/casusersync/")
public class CerCasUsersyncinfoController extends BaseController {

    @Autowired
    private CerCasUsersyncinfoService cerCasUsersyncinfoService;

    @PostMapping("listByPage")
    public ListResult<Object> listByPage(@RequestBody PageData pageData) {
        return ResultBuilder.buildListSuccess(cerCasUsersyncinfoService.listByPage(pageData));
    }

    @PostMapping("queryAllUnInitSysuserCount")
    public JsonObj queryAllUnInitSysuserCount() {
        int count = cerCasUsersyncinfoService.queryAllUnInitSysuserCount();
        Map<String, Object> result = new HashMap<>();
        result.put("count", count);
        return JsonObj.success(result);
    }
}
